package com.cloudfun.msglisten;

import com.cloudfun.campusshare.CampusshareHelloService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * Created by Huqin on 2019/12/20
 */
@Slf4j
@Component
public class DubboServiceRunner implements ApplicationRunner {

    @Reference(timeout = 3_000)
    private CampusshareHelloService campusshareHelloService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("Dubbo rmi invoke result:{}", campusshareHelloService.hello());
    }
}
